package org.jeecg.modules.car.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.enums.PayModeEnum;
import org.jeecg.enums.PayStatusEnum;
import org.jeecg.modules.system.entity.BaseEntity;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;

/**
 * @Description: 商户充值明细
 * @Author: liurui
 * @Date:   2020-10-21
 * @Version: V1.0
 */
@Data
@TableName("car_merchant_order")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="car_merchant_order对象", description="商户充值明细")
public class CarMerchantOrder extends BaseEntity {
    
	/**id*/
	@TableId(type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "id")
	private String id;
	/**租户id*/
    @ApiModelProperty(value = "租户id")
	private String tenantId;
	@ApiModelProperty(value = "projectId")
	private String projectId;
	/**商户id*/
    @ApiModelProperty(value = "商户id")
	private String merchantId;
	/**订单号(yyyyMMddHHmmss+M+4位流水号)*/
	@Excel(name = "订单号", width = 15)
    @ApiModelProperty(value = "订单号(yyyyMMddHHmmss+M+4位流水号)")
	private String sn;
	/**支付方式 alipay:支付宝,weixinpay:微信,offline:线下*/
    @ApiModelProperty(value = "支付方式 alipay:支付宝,weixinpay:微信,offline:线下")
	@Dict(dicCode = "pay_type")
	private String payType;

	/*@Excel(name = "支付方式", width = 15)
	@TableField(exist = false)
    private String payTypeStr;*/

	/**支付金额*/
	@Excel(name = "支付金额", width = 15)
    @ApiModelProperty(value = "支付金额")
	private BigDecimal payAmount;
	/**充值优惠规则（百分比）*/
	@Excel(name = "优惠金额", width = 15)
    @ApiModelProperty(value = "优惠金额")
	private java.math.BigDecimal discountAmount;
	/**实际到账金额*/
	@Excel(name = "实际到账金额", width = 15)
    @ApiModelProperty(value = "实际到账金额")
	private BigDecimal actualAmount;
	/**支付时间*/
	@Excel(name = "支付时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "支付时间")
	private java.util.Date payTime;

	/** 0 普通订单 1 积分订单 */
	@TableField(exist = true)
	private Integer orderType;

    @ApiModelProperty(value = "支付状态(0:未支付 1:支付成功 2:支付中 3：已退款  8:退款账单 -1:支付失败或用户取消 )")
	private java.lang.Integer payStatus;
	@Excel(name = "支付状态", width = 15)
	@TableField(exist = false)
    private String payStatusStr;
	/**参数化请求内容*/
    @ApiModelProperty(value = "参数化请求内容")
	private java.lang.String request;
	/**支付接口响应内容*/
    @ApiModelProperty(value = "支付接口响应内容")
	private java.lang.String response;
	/**充值状态(0:充值中 1:充值成功 9:充值失败)*/
//	@Excel(name = "充值状态", width = 15)
    @ApiModelProperty(value = "充值状态(0:充值中 1:充值成功 9:充值失败)")
	private java.lang.Integer chargeStatus;
	/**发票号*/
    @ApiModelProperty(value = "发票号")
	private java.lang.String invoiceNo;
	/**开票时间*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开票时间")
	private java.util.Date invoiceTime;
	/**开票人*/
    @ApiModelProperty(value = "开票人")
	private java.lang.String invoiceName;
	/**开票手机号*/
    @ApiModelProperty(value = "开票手机号")
	private java.lang.String invoiceMobile;
	/**开票状态*/
    @ApiModelProperty(value = "开票状态")
	private java.lang.Integer invoiceStatus;
	/**开票税号*/
    @ApiModelProperty(value = "开票税号")
	private java.lang.String invoiceEin;
	/**开票邮箱*/
    @ApiModelProperty(value = "开票邮箱")
	private java.lang.String invoiceEmail;
	/**开票地址*/
    @ApiModelProperty(value = "开票地址")
	private java.lang.String invoiceAddress;
	/**开票账号*/
    @ApiModelProperty(value = "开票账号")
	private java.lang.String invoiceAccount;
	/**充值支付方式（0:app ）*/
//	@Excel(name = "充值支付模式", width = 15)
    @ApiModelProperty(value = "充值支付模式")
	//@Dict(dicCode = "pay_mode")
	private java.lang.String payMode;

	@Excel(name = "支付模式", width = 15)
	@TableField(exist = false)
	private String payModeStr;

	@Excel(name = "银行订单号", width = 15)
	@ApiModelProperty(value = "银行订单号")
	private String transNo;

	/**本次支付完结余*/
	@Excel(name = "本次支付完结余", width = 15)
    @ApiModelProperty(value = "本次支付完结余")
	private BigDecimal balance;
	/**实际操作者*/
	@Excel(name = "操作者", width = 15)
    @ApiModelProperty(value = "操作者")
	private java.lang.String operUser;
	/**创建者*/
    @ApiModelProperty(value = "创建者")
	private java.lang.String createBy;
	/**创建时间*/
//	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;
	/**更新者*/
//	@Excel(name = "更新者", width = 15)
    @ApiModelProperty(value = "更新者")
	private java.lang.String updateBy;
	/**更新时间*/
//	@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
	private java.util.Date updateTime;
	/**删除标志*/
    @ApiModelProperty(value = "删除标志")
	private java.lang.String delFlag;

	/**备注*/
	@Excel(name = "备注", width = 15)
	@ApiModelProperty(value = "备注")
	private java.lang.String remarks;

	@TableField(exist = false)
	private String merchantName;
	//搜索条件 开始时间
	@TableField(exist = false)
	private String startTime;
	//搜索条件 结束时间
	@TableField(exist = false)
	private String endTime;

	@TableField(exist = false)
	private String createName;

	public String getPayStatusStr() {
		return PayStatusEnum.getDesc(this.payStatus);
	}

	//TODO
	/*public String getPayTypeStr(){
		return PayModeEnum.getDesc(this.getPayType());
	}*/

	public String getPayModeStr() {
		return PayModeEnum.getDesc(this.getPayMode());
	}
}
